-- MySQL dump 10.13  Distrib 5.6.24, for Linux (x86_64)
--
-- Host: localhost    Database: portal_hinos
-- ------------------------------------------------------
-- Server version	5.6.24

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `ator`
--

DROP TABLE IF EXISTS `ator`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ator` (
  `cd_ator` int(11) NOT NULL AUTO_INCREMENT,
  `dsc_ator` varchar(100) NOT NULL,
  `num_telefone` varchar(12) DEFAULT NULL,
  `email` varchar(50) DEFAULT NULL,
  `end_rua` varchar(60) DEFAULT NULL,
  `end_num` varchar(20) DEFAULT NULL,
  `end_cep` varchar(8) DEFAULT NULL,
  `end_bairro` varchar(60) DEFAULT NULL,
  `cd_cidade` int(11) DEFAULT NULL,
  `cd_tipo` int(11) DEFAULT NULL,
  `autor` char(1) DEFAULT NULL,
  `cd_igreja` int(11) DEFAULT NULL,
  PRIMARY KEY (`cd_ator`),
  KEY `cd_cidade` (`cd_cidade`),
  KEY `cd_tipo` (`cd_tipo`),
  KEY `cd_igreja` (`cd_igreja`),
  CONSTRAINT `ator_ibfk_1` FOREIGN KEY (`cd_cidade`) REFERENCES `cidade` (`cd_cidade`),
  CONSTRAINT `ator_ibfk_2` FOREIGN KEY (`cd_tipo`) REFERENCES `tipo_ator` (`cd_tipo`),
  CONSTRAINT `ator_ibfk_3` FOREIGN KEY (`cd_igreja`) REFERENCES `igreja` (`cd_igreja`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `ator`
--

LOCK TABLES `ator` WRITE;
/*!40000 ALTER TABLE `ator` DISABLE KEYS */;
/*!40000 ALTER TABLE `ator` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `cidade`
--

DROP TABLE IF EXISTS `cidade`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cidade` (
  `cd_cidade` int(11) NOT NULL AUTO_INCREMENT,
  `desc_cidade` varchar(100) NOT NULL,
  `cd_estado` char(2) NOT NULL,
  PRIMARY KEY (`cd_cidade`),
  KEY `cd_estado` (`cd_estado`),
  CONSTRAINT `cidade_ibfk_1` FOREIGN KEY (`cd_estado`) REFERENCES `estado` (`cd_estado`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `cidade`
--

LOCK TABLES `cidade` WRITE;
/*!40000 ALTER TABLE `cidade` DISABLE KEYS */;
/*!40000 ALTER TABLE `cidade` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `estado`
--

DROP TABLE IF EXISTS `estado`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `estado` (
  `cd_estado` char(2) NOT NULL,
  `desc_estado` varchar(60) NOT NULL,
  PRIMARY KEY (`cd_estado`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `estado`
--

LOCK TABLES `estado` WRITE;
/*!40000 ALTER TABLE `estado` DISABLE KEYS */;
/*!40000 ALTER TABLE `estado` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `hino`
--

DROP TABLE IF EXISTS `hino`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `hino` (
  `cd_hino` int(11) NOT NULL AUTO_INCREMENT,
  `dsc_hino` varchar(100) NOT NULL,
  `cifra` varchar(1000) DEFAULT NULL,
  `audio` mediumblob,
  `origem_hino` varchar(100) DEFAULT NULL,
  `lista_santa_ceia` char(1) NOT NULL,
  `bloqueado` char(1) DEFAULT 'N',
  `motivo_bloqueado` varchar(100) DEFAULT NULL,
  `audio_hino` mediumblob,
  PRIMARY KEY (`cd_hino`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `hino`
--

LOCK TABLES `hino` WRITE;
/*!40000 ALTER TABLE `hino` DISABLE KEYS */;
/*!40000 ALTER TABLE `hino` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `igreja`
--

DROP TABLE IF EXISTS `igreja`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `igreja` (
  `cd_igreja` int(11) NOT NULL AUTO_INCREMENT,
  `dsc_nome_igreja` varchar(100) NOT NULL,
  `dsc_pastor` varchar(300) NOT NULL,
  `cd_cidade` int(11) DEFAULT NULL,
  PRIMARY KEY (`cd_igreja`),
  KEY `cd_cidade` (`cd_cidade`),
  CONSTRAINT `igreja_ibfk_1` FOREIGN KEY (`cd_cidade`) REFERENCES `cidade` (`cd_cidade`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `igreja`
--

LOCK TABLES `igreja` WRITE;
/*!40000 ALTER TABLE `igreja` DISABLE KEYS */;
/*!40000 ALTER TABLE `igreja` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `programacao_reuniao`
--

DROP TABLE IF EXISTS `programacao_reuniao`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `programacao_reuniao` (
  `cd_programacao` int(11) NOT NULL AUTO_INCREMENT,
  `cd_reuniao` int(11) NOT NULL,
  `cd_hino` int(11) NOT NULL,
  `cd_ator` int(11) NOT NULL,
  `nota` varchar(100) DEFAULT NULL,
  `audio_introducao` mediumblob,
  `sequencia` int(11) DEFAULT NULL,
  PRIMARY KEY (`cd_programacao`),
  KEY `cd_reuniao` (`cd_reuniao`),
  KEY `cd_hino` (`cd_hino`),
  KEY `cd_ator` (`cd_ator`),
  CONSTRAINT `programacao_reuniao_ibfk_1` FOREIGN KEY (`cd_reuniao`) REFERENCES `reuniao` (`cd_reuniao`),
  CONSTRAINT `programacao_reuniao_ibfk_2` FOREIGN KEY (`cd_hino`) REFERENCES `hino` (`cd_hino`),
  CONSTRAINT `programacao_reuniao_ibfk_3` FOREIGN KEY (`cd_ator`) REFERENCES `ator` (`cd_ator`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `programacao_reuniao`
--

LOCK TABLES `programacao_reuniao` WRITE;
/*!40000 ALTER TABLE `programacao_reuniao` DISABLE KEYS */;
/*!40000 ALTER TABLE `programacao_reuniao` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `reuniao`
--

DROP TABLE IF EXISTS `reuniao`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `reuniao` (
  `cd_reuniao` int(11) NOT NULL AUTO_INCREMENT,
  `dsc_reuniao` varchar(100) NOT NULL,
  `cd_tipo_reuniao` int(11) DEFAULT NULL,
  `data` date DEFAULT NULL,
  `cd_igreja` int(11) NOT NULL,
  PRIMARY KEY (`cd_reuniao`),
  KEY `cd_tipo_reuniao` (`cd_tipo_reuniao`),
  KEY `cd_igreja` (`cd_igreja`),
  CONSTRAINT `reuniao_ibfk_1` FOREIGN KEY (`cd_tipo_reuniao`) REFERENCES `tipo_reuniao` (`cd_tipo_reuniao`),
  CONSTRAINT `reuniao_ibfk_2` FOREIGN KEY (`cd_igreja`) REFERENCES `igreja` (`cd_igreja`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `reuniao`
--

LOCK TABLES `reuniao` WRITE;
/*!40000 ALTER TABLE `reuniao` DISABLE KEYS */;
/*!40000 ALTER TABLE `reuniao` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tipo_ator`
--

DROP TABLE IF EXISTS `tipo_ator`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tipo_ator` (
  `cd_tipo` int(11) NOT NULL AUTO_INCREMENT,
  `dsc_tipo_ator` varchar(100) NOT NULL,
  PRIMARY KEY (`cd_tipo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tipo_ator`
--

LOCK TABLES `tipo_ator` WRITE;
/*!40000 ALTER TABLE `tipo_ator` DISABLE KEYS */;
/*!40000 ALTER TABLE `tipo_ator` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tipo_reuniao`
--

DROP TABLE IF EXISTS `tipo_reuniao`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tipo_reuniao` (
  `cd_tipo_reuniao` int(11) NOT NULL AUTO_INCREMENT,
  `dsc_tipo_reuniao` varchar(100) NOT NULL,
  `qtde_hinos` int(11) DEFAULT NULL,
  PRIMARY KEY (`cd_tipo_reuniao`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tipo_reuniao`
--

LOCK TABLES `tipo_reuniao` WRITE;
/*!40000 ALTER TABLE `tipo_reuniao` DISABLE KEYS */;
/*!40000 ALTER TABLE `tipo_reuniao` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `usuario`
--

DROP TABLE IF EXISTS `usuario`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuario` (
  `cd_usuario` int(11) NOT NULL AUTO_INCREMENT,
  `nome_usuario` varchar(50) NOT NULL,
  `login_usuario` varchar(50) NOT NULL,
  `senha_usuario` varchar(50) NOT NULL,
  `cd_igreja_usuario` int(11) NOT NULL,
  PRIMARY KEY (`cd_usuario`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `usuario`
--

LOCK TABLES `usuario` WRITE;
/*!40000 ALTER TABLE `usuario` DISABLE KEYS */;
INSERT INTO `usuario` VALUES (1,'administrador','admin','admin',1);
/*!40000 ALTER TABLE `usuario` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2015-05-21 17:07:23
